package file;

import java.io.*;

public class Demo1 {
    public static void main(String[] args) {
        try(InputStream inputStream=new FileInputStream("d:/test.txt")) {
            byte[] buffer=new byte[1024];
            while (true){
                int len=inputStream.read(buffer);
                if(len==-1){
                    break;
                }
                String str=new String(buffer,0,len,"UTF-8");
                System.out.println(str);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
